﻿namespace GTAuto.DAL.Entities
{
    public class GTRegion : Region
    {
        public void UpdateTo(Region c)
        {
            foreach (var prop in c.GetType().GetProperties())
            {
                var prop2 = c.GetType().GetProperty(prop.Name);
                prop2.SetValue(this, prop.GetValue(c, null), null);
            }
        }

        public string FullName
        {
            get
            {
                if (Type == "республика")
                {
                    return Type + " " + Name;
                }


                if (Type == "край" || Type == "область" || Type == "автономная область" || Type == "автономный округ")
                {
                    return Name + " " + Type;
                }
                

                if (Type == "город")
                {
                    return Name;
                }
                return "";
            }
        }
    }
}
